"use strict";

const Service = require("egg").Service;

class UserService extends Service {
    //登录时的查询
    async chaxun(name) {
        let sql = "select *from login where name=?";
        let params = [name];
        let res = await this.app.mysql.query(sql, params);
        return res[0];
    }
    //查询所有信息
    async search() {
        let sql = "select *from login";
        return await this.app.mysql.query(sql);
    }
}

module.exports = UserService;
